package com.entrogy.dao;

import com.entrogy.bean.BusLineEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName BusLineMapper
 * @Description
 * @Author luoxingjiang
 * @Date 2019-11-08 上午 10:08
 * @Version 1.0
 **/
@Repository
public interface BusLineMapper {

    /**
     * 查询校车全部路线
     * @param schoolCode
     * @return
     */
    List<BusLineEntity> listSchoolBusLine(@Param("schoolCode") Integer schoolCode);

    /**
     * 新增学校路线
     * @param busLine
     * @return
     */
    int insertBusLine(BusLineEntity busLine);

    /**
     * 删除学校路线id
     * @param busLineId
     * @return
     */
    int deleteBusLine(@Param("busLineId") Integer busLineId, @Param("operateUserId") String operateUserId);

    /**
     * 更新校车路线
     * @param busLine
     * @return
     */
    int updateBusLine(BusLineEntity busLine);

    /**
     * 查询路线数量
     * @param schoolCode
     * @return
     */
    Integer countSchoolBusLine(Integer schoolCode);

    /**
     * 将该校车路线上的学生的schoolbusline_id置位null
     * @param busLineId
     * @return
     */
    int updateAllSchoolStudentBusLine(@Param("busLineId") String busLineId);
}
